package com.huawei.appgallery.search.ui.node;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout.LayoutParams;
import com.huawei.appgallery.search.ui.card.SearchBannerCard;
import o.azb;
import o.cht;
import o.cih;
import o.cuv.b;
import o.cuv.e;
import o.cvo;

public class SearchBannerNode extends cht {
    public SearchBannerNode(Context context) {
        super(context, 1);
    }

    public boolean ˊ(ViewGroup viewGroup, ViewGroup viewGroup2) {
        View inflate = LayoutInflater.from(this.ॱ).inflate(e.ˊ, null);
        ॱ(inflate.findViewById(b.ˊˊ));
        azb.ˏ(inflate);
        cih searchBannerCard = new SearchBannerCard(this.ॱ);
        searchBannerCard.ˏ(inflate);
        ˊ(searchBannerCard);
        viewGroup.addView(inflate, new LayoutParams(-1, -2));
        return true;
    }

    private void ॱ(View view) {
        int ˊ = cvo.ˊ();
        int i = (int) (((float) ˊ) * 0.42857143f);
        ViewGroup.LayoutParams layoutParams = view.getLayoutParams();
        layoutParams.width = ˊ;
        layoutParams.height = i;
        view.setLayoutParams(layoutParams);
    }
}
